package common;

import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

public class MyUtils {
	public static String getUUID() {
		Calendar cal = Calendar.getInstance();
		int year = cal.get(Calendar.YEAR);// 获取年份
		int month = cal.get(Calendar.MONTH) + 1;// 获取月份
		int day = cal.get(Calendar.DATE);// 获取日
		int hour = cal.get(Calendar.HOUR_OF_DAY);// 小时
		int minute = cal.get(Calendar.MINUTE);// 分
		int second = cal.get(Calendar.SECOND);// 秒
		return year + "" + month + "" + day + "" + hour + "" + minute + "" + second;
	}
	public static boolean isEmptyStr(String tagValue) {
		if (tagValue == null || tagValue.trim().equals("")
				|| tagValue.trim().equals("null")) {
			return true;
		} else {
			return false;
		}
	}
	 public static boolean createFile(File file) throws IOException {  
	        if(! file.exists()) {  
	            makeDir(file.getParentFile());  
	        }  
	        return file.createNewFile();  
	    }  
	 public static void makeDir(File dir) {  
	        if(! dir.getParentFile().exists()) {  
	            makeDir(dir.getParentFile());  
	        }  
	        dir.mkdir();  
	    }  
}
